import request from '@/utils/request'

export function pageRepository(data) {
  return request({
    url: '/api/fd/repository/page',
    method: 'post',
    data
  })
}

export function listRepository(data) {
  return request({
    url: '/api/fd/repository/list',
    method: 'post',
    data
  })
}

export function saveRepository(data) {
  return request({
    url: '/api/fd/repository/save',
    method: 'post',
    data
  })
}


export function updateRepository(data) {
  return request({
    url: '/api/fd/repository/update',
    method: 'post',
    data
  })
}

/**
 * 知识库查询（知识库所属类型，知识库所属，知识库名称模糊）
 * @param data
 * @returns {AxiosPromise}
 */
export function list(data) {
  return request({
    url: '/api/fd/repository/list',
    method: 'post',
    data
  })
}

/**
 * 通过id查询知识库信息
 * @param data
 * @returns {AxiosPromise}
 */
export function getRepository(data) {
  return request({
    url: '/api/fd/repository/get',
    method: 'post',
    data
  })
}

/**
 * 通过id删除知识库
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteRepository(data) {
  return request({
    url: '/api/fd/repository/delete',
    method: 'post',
    data
  })
}


// 获取个人部门和文档/api/fd/repository/get_user_group_and_repositor

export function getUserGroup(data) {
  return request({
    url: '/api/fd/repository/get_user_group_and_repositor',
    method: 'post',
    data
  })
}

export function listRepositoryMemberPermissions() {
  return request({
    url: '/api/fd/repository/list_repository_member_permissions',
    method: 'post'
  })
}
// /api/fd/repository/list_team_tree获取团队知识库的树
export function listTeamTree(data) {
  return request({
    url: '/api/fd/repository/list_team_tree',
    method: 'post',
    data 
  })
}